package com.tebiecloud.retail.client.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.tebiecloud.common.model.ResultBody;
import com.tebiecloud.retail.client.model.entity.RetailOrder;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.Map;

/**
 * 分销订单接口
 * @Author: tebie
 * @Date: 2019-09-17 13:49
 */
public interface IRetailOrderServiceClient {

    /**
     * 获取分销订单信息
     * @param OrderId
     * @return
     */
    @PostMapping("/feign/order/infoRetailOrder")
    ResultBody<RetailOrder> getRetailOrder(@RequestParam(value = "orderId") long OrderId);

    /**
     * 获取我的分销订单分页列表（包含自己与下级的订单）
     * @param map page,limit,sort,order,
     *            userId(用户id)
     *            status(订单状态，0已取消1待付款2待分销4已分销6已退款，多个状态时逗号隔开)
     * @return
     */
    @PostMapping("/feign/order/listMyRetailOrder")
    ResultBody<Page<RetailOrder>> listMyRetailOrder(@RequestParam(required = false) Map map);

    /**
     * 更新分销订单信息
     * @param orderId
     * @param status 订单状态，0已取消1待付款2待分销4已分销6已退款
     * @return
     */
    @PostMapping("/feign/order/updateRetailOrder")
    ResultBody updateRetailOrder(@RequestParam(value = "orderId") long orderId,
                                 @RequestParam(value = "status") int status);

    /**
     * 获利多少
     * @param pthreeUserId
     * @param orderId
     * @param profit
     * @param userId
     * @param status
     * @return
     */
    @PostMapping("/feign/order/saveRetailOrder")
    ResultBody saveRetailOrder(@RequestParam(value = "pthreeUserId") long pthreeUserId,
                               @RequestParam(value = "orderId") long orderId,
                               @RequestParam(value = "profit") int profit,
                               @RequestParam(value = "userId") long userId,
                               @RequestParam(value = "status") int status);

}
